package com.sjk.flink.correct.rules;

import com.sjk.flink.correct.IfCorrectRule;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class FloatRuler implements IfCorrectRule {

    private static final Logger log = LoggerFactory.getLogger(FloatRuler.class);

    @Override
    public String getName() {
        return "Float";
    }

    @Override
    public Object transformValue(Object val) {
        if(val!=null) {
            try {
                return Float.parseFloat(val.toString());
            }catch (Exception ex){
                ex.printStackTrace();
            }
        }
        return val;
    }

}